<template>
	<div id="allstatus" style="height: 260px;width: 100%;margin-left: 0px;"></div>
</template>

<script>
import * as echarts from 'echarts';
import { orderCountTone } from '@/api/account'
export default {
	data() {
		return {
		}
	},
	mounted() {
		orderCountTone().then((res) => {
			(function () {
				var chartDom = document.getElementById('allstatus');
				var myChart = echarts.init(chartDom);
				var option;
				option = {
					title: {
						text: '所有订单统计',
						// subtext: '订单统计',
						left: 'center'
					},
					tooltip: {
						trigger: 'item'
					},
					legend: {
						orient: 'horizontal',
						y: 'bottom',
						x: 'center'
					},
					series: [
						{
							name: '所有订单统计',
							type: 'pie',
							radius: '50%',
							data: [
								{ value: res[0].t1 + res[2].t7 + res[4].t30, name: '其他订单' },
								{ value: res[1].t1 + res[3].t7 + res[5].t30, name: '今日被分配订单' },
							],
							emphasis: {
								itemStyle: {
									shadowBlur: 10,
									shadowOffsetX: 0,
									shadowColor: 'rgba(0, 0, 0, 0.5)'
								}
							}
						}
					]
				};
				option && myChart.setOption(option);
			})();
		});
	},
	methods: {

	}
}
</script>

<style lang="scss" scoped>

</style>
